Imports System.Data
Imports System.Data.SqlClient
Imports System.Net.Mail
Imports System.Threading
Imports System.Globalization

Public Class AutoDairyReport

    Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
        My.Settings.ToEmail = Me.txtEmail.Text
        If DxValidationProvider1.Validate = False Then
            Exit Sub
        End If

        Dim str As String
        str = "SELECT * FROM TransactionView WHERE TTDate = @TTDate"
        Dim cmd As New SqlCommand(str, gCnnPCE)
        cmd.Parameters.AddWithValue("@TTDate", Me.cboDate.DateTime)
        Dim da As New SqlDataAdapter(cmd)
        Dim ds As New DataSet
        da.Fill(ds, "Transaction")


        Dim i As Integer
        For i = 0 To ds.Tables(0).Rows.Count - 1

        Next


        'Try
        '    Dim SmtpServer As New SmtpClient()
        '    Dim mail As New MailMessage()
        '    SmtpServer.Credentials = New Net.NetworkCredential("regisms@zhen192.com", "leiling@1983")
        '    SmtpServer.Port = 587
        '    SmtpServer.Host = "mail.zhen192.com"
        '    mail = New MailMessage()
        '    mail.From = New MailAddress("regiSMS@zhen192.com")
        '    mail.To.Add("register@zhen192.com")
        '    mail.Subject = "PRM-Register iSMS" & " From : " & Me.txtUserName.Text
        '    mail.Body = "User Name : " & Me.txtUserName.Text & vbCrLf & "User Password : " & Me.txtPassword.Text & vbCrLf & "Mobile No : " & Me.txtMobileNo.Text & vbCrLf & "Email : " & Me.txtEmail.Text
        '    SmtpServer.Send(mail)
        '    MsgBox("Application Submit. Please give us 1 working days to progress", MsgBoxStyle.Information)
        '    Me.Close()
        'Catch ex As Exception
        '    MsgBox(ex.ToString)
        'End Try






































    End Sub

    Private Sub AutoDairyReport_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        LoadIcon(Me)
        Me.txtEmail.Text = My.Settings.ToEmail
        Me.cboDate.DateTime = Now

    End Sub
End Class